<!DOCTYPE html>

<!-- <div>
	<div>姓名: <span></span></div>
	<div>年龄: </div>
	<div>性别: </div>
</div>
 -->
<script>
	var user = {
		name: '张三',
		age: '30',
		sex: '男',
	}
	var div = document.createElement("div");
	div.id = "user"
	var temp = `<div>姓名:${user.name} </div>
	<div>年龄:${user.age} </div>
	<div>性别:${user.sex} </div>`;
	document.body.appendChild("div");
	document.getElementById("user")[0].innerHTML = temp;
	
</script>
